﻿cmake_minimum_required (VERSION 3.8)

if (POLICY CMP0141)
  cmake_policy(SET CMP0141 NEW)
  set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project ("QBiliDanmuBot")

if(MSVC)
  add_compile_options(/utf-8)
  add_compile_options(/EHsc)
endif()

# 禁用共享库构建（只构建静态库）
set(BUILD_SHARED_LIBS false)

# 禁用其他不需要的部分
set(BUILD_CURL_EXE false)
set(BUILD_EXAMPLES false)
set(BUILD_LIBCURL_DOCS false)
set(BUILD_MISC_DOCS false)

if (WIN32)
	# WINDOWS环境直接使用系统库处理SSL
	set(CURL_USE_SCHANNEL true)
endif()

# 引入curl库 (http/https请求支持)
add_subdirectory("libs/curl")

add_subdirectory("QBiliDanmuBot")